package router

import (
	"api-gateway/basic/config"
	"api-gateway/handler/api"
	"github.com/gin-gonic/gin"
	"github.com/share309/gojwt"
)

func Router(r *gin.Engine) {
	apiGroup := r.Group("/apiGroup")
	{
		user := apiGroup.Group("/user")
		{
			//用户登录
			user.POST("/register", api.RegisterUser)
			//用户登录
			user.POST("/Login", api.LoginUser)
		}
		ke := apiGroup.Group("/ke")
		{
			//课程展示
			ke.GET("/list", api.ListKe)
			//课程删除
			ke.POST("/delete", api.DeleteKe)
			//课程详情
			ke.GET("/detail", api.Detail)
			//用户收藏
			ke.GET("/collect", api.CollectUser)
			ke.Use(gojwt.JWTAuth(config.JWT_KEY))
			//课程分页
			ke.GET("/lsitKe", api.KeList)
		}
	}
}
